package jk.spider.core.task.threading;

import jk.spider.core.task.dispatch.DispatcherTask;

public class DispatcherThread extends Thread {
	protected DispatcherTask task;
	public DispatcherThread(ThreadGroup group, String name) {
		super(group, name);
	}
	
	public void assign(DispatcherTask task) {
		this.task = task;
		start();
	}
	
	public void run() {
		synchronized(task) {
			task.execute();
			task.notify();
		}
	}
}
